# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-textblob
pkgname=('python2-textblob' 'python-textblob')
_pkgname=textblob
pkgver=0.19.0
pkgrel=1
pkgdesc='Pythonic text processing. Sentiment analysis, part-of-speech tagging, and more.'
arch=('any')
url='https://pypi.org/project/textblob/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('fb573dca087689359717aa5451bb1531cc060f6d4bfe427fd61b4e0bd1d537f88db923ecbfea444b3715a260e79e92c31b586572fc84bf2693143eaa68979e5c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-textblob() {
  depends=('python2' 'python2-nltk' 'python2-singledispatch')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-textblob() {
  depends=('python' 'python-nltk')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

